import * as types from '../types'

export default {
  namespaced: true,
  state: {
    info: {},
    updated: false
  },
  getters: {
    info: state => state.info,
    updated: state => state.updated
  },
  actions: {
    updateTaskInfo ({commit, state}, data) {
      commit(types.TASK_INFO, data)
    },
    updateTaskStatus ({commit, state}, data) {
      commit(types.TASK_STATUS, data)
    }
  },
  mutations: {
    [types.TASK_INFO] (state, payload) {
      state.info = payload
    },
    [types.TASK_STATUS] (state, payload) {
      state.updated = payload
    }
  }
}
